package contraintes;

import java.util.ArrayList;
import java.util.Iterator;

public class ConstanteUE {
	private int id;
	private int nbCours;
	private int nbTd;
	private int nbTp;
	private ArrayList<Seance> listSeance;
	
	public int getId() {
		return id;
	}
	public int getNbCours() {
		return nbCours;
	}
	public int getNbTd() {
		return nbTd;
	}
	public int getNbTp() {
		return nbTp;
	}
	public void ajoutSeance(Seance s) {
		listSeance.add(s);
	}
	
	public ArrayList<Seance> getListSeance() {
		return listSeance;
	}
	
	public Seance getSeance(int id) {
		Iterator<Seance> iteS = listSeance.iterator();
		while(iteS.hasNext()) {
			Seance s = iteS.next();
			if(s.getId()==id)
				return s;
		}
		return null;
	}
	
	public ConstanteUE(int id, int nbCours, int nbTd, int nbTp) {
		this.id = id;
		this.nbCours = nbCours;
		this.nbTd = nbTd;
		this.nbTp = nbTp;
		this.listSeance = new ArrayList<Seance>();
	}
}
